

#import <Cocoa/Cocoa.h>

@class CIImage;
@class CATransition;

// SlideshowView demonstrates the use of CATransition animations with a layer-backed view subtree.  A SlideshowView displays a single NSImage at a time, and can be asked to switch to a different NSImage via the -transitionToImage: method.

// Following is the set of transition styles that SlideshowView supports.  Some map to Core Animation's built-in transition types; the rest are implemented using Core Image's standard set of transition filters.

typedef enum {
    // Core Animation's four built-in transition types
    SlideshowViewFadeTransitionStyle,
    SlideshowViewMoveInTransitionStyle,
    SlideshowViewPushTransitionStyle,
    SlideshowViewRevealTransitionStyle,

    // Core Image's standard set of transition filters
    SlideshowViewCopyMachineTransitionStyle,
    SlideshowViewDisintegrateWithMaskTransitionStyle,
    SlideshowViewDissolveTransitionStyle,
    SlideshowViewFlashTransitionStyle,
    SlideshowViewModTransitionStyle,
    SlideshowViewPageCurlTransitionStyle,
    SlideshowViewRippleTransitionStyle,
    SlideshowViewSwipeTransitionStyle,

    NumberOfSlideshowViewTransitionStyles
} SlideshowViewTransitionStyle;

@interface SlideshowView : NSView
{
    NSImageView     *currentImageView;          // an NSImageView that displays the current image, as a subview of the SlideshowView
    int             transitionStyle;            // the style of transition to use; one of the SlideshowViewTransitionStyle values enumerated above
    BOOL            autoCyclesTransitionStyle;  // set if we should automatically cycle our transitionStyle
    CIImage         *inputShadingImage;         // an environment-map image that the transition filter may use in generating the transition effect
    CIImage         *inputMaskImage;            // a mask image that the transition filter may use in generating the transition effect
}
- initWithFrame:(NSRect)newFrame;

- (SlideshowViewTransitionStyle)transitionStyle;
- (void)setTransitionStyle:(SlideshowViewTransitionStyle)newTransitionStyle;

- (BOOL)autoCyclesTransitionStyle;
- (void)setAutoCyclesTransitionStyle:(BOOL)flag;

- (void)transitionToImage:(NSImage *)newImage;
@end
